package com.ruoci.redis.utils;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

/**
 * @Author yang
 **/
public class DateUtils {

    private DateUtils(){

    }

    /**
     * 获取当前月的总天数
     * @param date
     * @return
     */
    public static int  lengthOfMonth(Date date){
        boolean leapYear = DateUtil.isLeapYear(DateUtil.year(date));
        int month = DateUtil.month(date)+1;
        return DateUtil.lengthOfMonth(month, leapYear);
    }
}
